home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
-
- // Insert script helper for:
-
- /**
- @Object: String
- @Method: indexOf - returns the character index of the of
- of the substring. The search starts at the beginning of the
- string or at the character position specified by start.
- If the substring is not found the value -1 is returned.
-
- IMPORTANT: Do NOT call with a start value greater
- than or equal to the string length. Thus calling
- indexOf(string, 0) when the string is empty will result
- in a null value being returned for the index (not
- equal to -1 or any other integer).
- @Syntax: string.indexOf(substring, [start])
- @Summary: indexOf - returns the character index where the match was found
- */
-
- function DoCommand()
- {
- var editor = getActiveEditor();
- if (editor)
- {
- var selection = editor.getSelection();
- editor.replace("string.indexOf(substring, [start])", selection);
- editor.setActive("Insert string.indexOf");
- }
- }
-
- !!/Script
-